package com.itheima.sh.user.service;

import com.itheima.sh.pojo.User;
import com.itheima.sh.user.mapper.UserMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Primary
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public User queryById(String username) {
        System.out.println("UserService...");
        if(username.equals("itheima")){
            throw new RuntimeException("请求失败");
        }
        return userMapper.findById(username);
    }
}
